package edu.ycxy.poetry.vo;

import lombok.Data;
import lombok.experimental.Accessors;

import java.io.Serializable;

/**
 * @Author @xin
 * @createDate 2022/5/1
 * @Description 添加古籍的vo类
 */
@Data
@Accessors(chain = true)
public class AddDjVo implements Serializable {
    private String title;
    private String info;
    private String zuozhe;
    private String[] type;
    private String djTitle;
    private String body;

    /**
     * 重写get方法，将数组转化为string类型，并使用"|"进行分割，对应数据库的数据
     * @return
     */
    public String getType() {
        String s = "";
        for (int i = 0; i < type.length; i++) {
            s += type[i] + "|";
        }
        return s;
    }
}
